#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import os
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

from tools.stocktools import StockPriceTool

def test_stock_tool():
    """直接测试股票工具"""
    print("测试金山软件股价工具")
    print("=" * 40)
    
    tool = StockPriceTool()
    print(f"工具名称: {tool.name}")
    print(f"工具描述: {tool.description}")
    
    print("\n执行股票价格查询...")
    result = tool.execute({
        "symbol": "3888.HK",
        "company_name": "金山软件"
    })
    
    print(f"执行成功: {result['success']}")
    print(f"输出内容: {result['stdout']}")
    if result['stderr']:
        print(f"错误信息: {result['stderr']}")

if __name__ == "__main__":
    test_stock_tool()